﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace RemoteTestRunner.BusinessLogic
{
    public static class TrxParserFactory
    {
        public static ITrxParser GetParser(string testResultsPath)
        {

            XmlDocument doc = new XmlDocument();
            doc.Load(testResultsPath);

            switch (doc.DocumentElement.NamespaceURI)
            {
                case "http://microsoft.com/schemas/VisualStudio/TeamTest/2010":
                    return new TrxParser2010();
                    //break;
                case "http://microsoft.com/schemas/VisualStudio/TeamTest/2006":
                    return new TrxParser2006();
                    //break;
                default:
                    break;
            }


            return null;
        }
    }
}
